<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link type="text/css" rel="stylesheet" href="css/personal.css"/>
    <script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>
    <script type="text/javascript" src="js/personal.js"></script>
    <title>个人中心-我的职位</title>
    <script type="text/javascript" src="js/jquery-1.8.3.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            /**
             *根据用户电话查id
             */
                // const constPhone = sessionStorage.getItem('phone');
            var constPhone = 13633249902;
            $.get("EnterpriceAndPosts/selectId", {"phone": constPhone}, function (uid) {
                sessionStorage.setItem("uid", uid);

                /**
                 * 开始时对信息的展示
                 */
                const id = sessionStorage.getItem("uid")
                $.get("EnterpriceAndPosts/show", {"id": id}, function (pos) {
                    show(pos.list);
                    showBut(pos);
                });
                /**
                 * 根据输入框带条件查询
                 */
                $("[name='提交']").click(function () {
                    var pname = $("[name='chazhao']").val();
                    $.get("EnterpriceAndPosts/show", {"id": id, "pname": pname}, function (pos) {
                        showBut(pos);
                        show(pos.list);
                    });
                });
            });
        });

        /**
         * 展示分页按钮
         */
        function showBut(pos) {
            $("#fenye").empty();
            for (var i = 0; i < pos.totalPages; i++) {
                $("   <a id='" + i + "' href=\"javascript:void(0)\" class=\"fy2 on\">" + (i + 1) + "</a>").appendTo("#fenye");
            }
        }

        /**
         *为分页按钮绑定事件
         */
        $(document).on("click", ".fy2.on", function () {
            var page = $(this).text();
            const id = sessionStorage.getItem("uid")
            $.get("EnterpriceAndPosts/show", {"id": id, "page": page}, function (pos) {
                show(pos.list);
                showBut(pos);
            });
        });


        /**
         * 展示职业信息的通用方法
         * @param pos
         */
        function show(pos) {
            $("#xinxi").empty();
            for (var i = 0; i < pos.length; i++) {
                var $row = $("<tr>\n" +
                    "   <td>\n" +
                    "       <a name='ppname' href=\"job_info.html\" class=\"jobname\">" + pos[i].pname + "</a>\n" +
                    "   </td>\n" +
                    "   <td>\n" +
                    "       <div class=\"company\">\n" +
                    "           <a name='bbusiness' href=\"company.html\">" + pos[i].business + "</a>\n" +
                    "       </div>\n" +
                    "   </td>\n" +
                    "   <td></td>\n" +
                    "   <td>" + pos[i].fullAddress + "</td>\n" +
                    "   <td><span>" + pos[i].sal + "</span></td>\n" +
                    "   <td>" + pos[i].lastTime + "</td>\n" +
                    "</tr>\n" +
                    "<tr class=\"xxdetail none\">\n" +
                    "   <td colspan=\"5\">\n" +
                    "       <div class=\"yaoqiu\">学历要求：中专 | 工作经验：1~2年 | 公司规模：少于50人 | 招聘方式：全职<br/>\n" +
                    "           岗位职责：1、 负责公司资产管理、办公用品采购及劳保用品的管理工作,避免公司资产流失和浪费； 2、 负责书刊资料印刷、快递、物流及办公室的其他事情； 3、\n" +
                    "           ...<br/>\n" +
                    "           岗位要求：1、1年以上行政工作经验； 2、熟悉行政工作流程，办公用品采购流程，企业资产管理； 3、较强的责任心和敬业精神，良好的组织协调能力及沟通能力，较...\n" +
                    "       </div>\n" +
                    "   </td>\n" +
                    "   <td>\n" +
                    "       <div class=\"applydiv\">\n" +
                    "           <a href=\"javascript:void(0);\" class=\"ysqbtn\">已申请</a>\n" +
                    "           <span class=\"ygz\">已关注</span>\n" +
                    "       </div>\n" +
                    "   </td>\n" +
                    "</tr>");
                // 将生成的行添加到表格中
                $row.appendTo("#xinxi");
            }
        }

        // 为动态添加的元素绑定点击事件
        $(document).on("click", "[name='ppname']", function () {
            const pname = $(this).text();  // 获取当前点击的职位名
            const business = $(this).closest('tr').find("[name='bbusiness']").text();  // 获取当前行中的公司名
            sessionStorage.setItem('pname', pname);
            sessionStorage.setItem('business', business);
        });
    </script>
</head>

<body>
<div class="header">
    <div class="headerMain">
        <div class="Notice">
        </div>
        <div class="Account">
            <div class="Left">
                <div class="Info">
                    <font>[28421947]</font>
                    <input type="button">
                    <div id="InfoPopup">
                        <ul>
                            <li><a href="../../../../target/classes/public/index.html">退出</a></li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="navTop">
    <div class="navTopmain">
        <div class="logo"><a href="../../../../target/classes/public/index.html"><img src="images/logo_1.png"/><img src="images/logo_2.png"/></a></div>
        <div class="nav">
        </div>
    </div>
</div>
<div class="personalBody">
    <div class="perRightcon">
        <div class="commonTit">
            <h1 class="fl">职位搜索</h1>
        </div>
        <div class="clear"></div>
        <div class="zwssPart1">
            <div class="zxssPart1_1">
                <input name="chazhao" type="text" placeholder="请填写关键词或选择职位"/>
            </div>
            <div class="zxssPart1_4">
                <input name="提交" type="button" value="搜工作"/>
            </div>
        </div>
        <div class="clear"></div>
        <div class="zwssPart3">
            <div class="seachlist">
                <div class="listtop">
                    <div class="tj1">
                        <span class="list on">列表</span>
                        <span class="zhaoyao">摘要</span>
                    </div>
                    <div class="tj3">
                        <span>共1141条  第1/39页</span>
                    </div>
                </div>
                <div class="clear"></div>
                <div class="listcon">
                    <table border="0" width="100%" cellpadding="0" cellspacing="0" class="listtab">
                        <thead>
                        <tr>
                            <th width="24%" style="padding-left:17px">职位名称</th>
                            <th width="30%">企业名称</th>
                            <th width="9%"></th>
                            <th width="16%">工作地点</th>
                            <th width="8%">薪水</th>
                            <th width="9%">刷新时间</th>
                        </tr>
                        </thead>
                        <tbody id="xinxi">


                        </tbody>
                    </table>
                </div>
                <div class="clear"></div>
                <div class="listbottom">
                    <!--                    //共1141条  第1/39页-->
                    <div class="lb3"><span></span></div>
                </div>
                <div class="clear"></div>
                <div class="fenyediv">
                    <a href="javascript:void(0)" class="fy1"></a>
                    <a href="javascript:void(0)" class="fy1"></a>
                    <div id="fenye">

                    </div>

                    <a href="javascript:void(0)" class="fy1"></a>
                    <a href="javascript:void(0)" class="fy1"></a>
                </div>
                <div class="clear"></div>
            </div>
        </div>
    </div>
</div>


<div class="clear"></div>
<div class="footer">
</div>
</body>

</html>
